class customNav {
    public statusBar: number = 0//状态栏高度
    public navbar: number = 0; // 导航栏高度（不包括状态栏高度）
    public customBar: number = 0; //顶部高度（状态栏高度 + 导航栏高度） 
    constructor() {
        this.getNavHeight();
    }
    getNavHeight() {
        uni.getSystemInfo({
            success: (e) => {
                // #ifdef MP
                this.statusBar = e.statusBarHeight || 0;
                this.customBar = this.statusBar + 45;
                if (e.platform === "android") {

                    this.customBar = this.statusBar + 50;
                }
                // #endif

                // #ifdef MP-WEIXIN
                const custom = wx.getMenuButtonBoundingClientRect();
                this.customBar = custom.bottom + custom.top - this.statusBar;
                this.navbar = (custom.top - this.statusBar) * 2 + custom.height;

                // #endif
            },
        });
    }

}
export default new customNav();